<!DOCTYPE html>
<html>

	<head lang="en">
		<meta charset="UTF-8">
		<title>访问当当购物车页面节点</title>
		<link rel="stylesheet" href="../../css/cartStyle.css" />
	</head>

	<body>

		<div class="content">
			<div class="logo">
				<img src="../../img/dd_logo.jpg"><span onclick="close_plan();">关闭</span>
			</div>

			<div class="cartList" id="cartList">
				<ul>
					<li>¥<input type="text" name="price" value="21.90"></li>
					<li><input type="button" name="minus" value="-" onclick="minus(0);">
						<input type="text" name="amount" value="1">
						<input type="button" name="plus" value="+" onclick="plus(0);"></li>
					<li id="price0">¥21.90</li>
					<li>
						<p onclick="collection();">移入收藏</p>
						<p onclick="del();">删除</p>
					</li>
				</ul>
				<ul>
					<li>¥<input type="text" name="price" value="24.00"></li>
					<li><input type="button" name="minus" value="-" onclick="minus(1);"><input type="text" name="amount" value="1"><input type="button" name="plus" value="+" onclick="plus(1);"></li>
					<li id="price1">¥24.00</li>
					<li>
						<p onclick="collection();">移入收藏</p>
						<p onclick="del();">删除</p>
					</li>
				</ul>
				<ol>
					<li id="totalPrice">&nbsp;</li>
					<li><span onclick="accounts();">结 算</span></li>
				</ol>
			</div>

			<div>
			</div>
		</div>
		<script>
			function accounts() {
				//				这是一个数组
				var danjia = document.getElementsByName("price");
				//这是一个数组
				var counts = document.getElementsByName("amount");
				//白说的总价
				var baizong = parseFloat(danjia[0].value) * parseFloat(counts[0].value);
				//岛上书店
				var daoshangs = parseFloat(danjia[1].value) * parseFloat(counts[1].value);

				var zong = baizong + daoshangs;

				var messages = "你本次购买的商品信息如下：<br/>白岩松：白说 ： ￥" + parseFloat(danjia[0].value) + "<br/>岛上书店：" + parseFloat(danjia[1].value) + "<br/>商品总计：" + zong;
				var dd = document.getElementById("cartList");
				dd.nextElementSibling.innerHTML = messages;

			}
		</script>
		<script type="text/javascript" src="../../js/shopping.js"></script>
	</body>

</html>